<div class="info">
<h1 class="font_h1">Tạo mới sản phẩm</h1>
<?php if(isset($error))  : ?>
<h2 class="error_red"><?php echo $error;?></h2>
<?php endif;?>
<form id="frm_add" action="<?php echo base_url().'admin/news_product/add_update/'.@$uid?>" method="post" enctype="multipart/form-data">
<table class="table1">    
    <tr>
                <td width="20%">Tiêu đề ngắn:</td>
                <td width="80%">
                	<?php if(isset($show->title)) {?>
                    <input type="text" name="txt_title" style="width:320px;" value="<?php set_value('txt_title')?><?php echo $show->title?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_title" style="width:320px;" value="<?php set_value('txt_title')?>" />
                    <?php } ?>
                </td>
    </tr>      
    <tr>
                <td width="20%"></td>
                <td width="80%">
                	<span style="background: red;width:200px"><?php echo form_error('txt_title');?></span>
                </td>
    </tr> 
    <tr>
                <td width="20%">Hình ảnh:</td>
                <td width="80%">
                <img src="<?php echo base_url();?><?php echo @$show->image_thumb;?>" /><br />
                <input type="hidden" name="image" value="<?php echo @$show->image;?>" /><br />
                <input type="hidden" name="image_thumb" value="<?php echo @$show->image_thumb;?>" /><br />
                <input type="file" name="p_image"/>
                </td>
    </tr> 
    <tr>
                <td width="20%">Tác giả:</td>
                <td width="80%">
                	<?php if(isset($show->author)) {?>
                    <input type="text" name="txt_author" style="width:320px;" value="<?php echo $show->author?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_author" style="width:320px;" value="<?php set_value('txt_author')?>" />
                    <?php } ?>
                </td>
    </tr>     
    <tr>
        <td width="20%">Tên danh mục:</td>
        <td width="80%">
        	<select name="txt_id_news">
        	<?php foreach($show_news as $row) {?>]
            	<?php if($show->id_news == $row->id_cat) {?>
                <option value="<?php echo $row->id_cat;?>" selected="selected"><?php echo $row->name_cat;?></option>	
                <?php } else {?>
                <option value="<?php echo $row->id_cat;?>"><?php echo $row->name_cat;?></option>	
                <?php } ?>
            	
            <?php } ?>
            </select>
        </td>
    </tr>
     <tr>
                <td width="20%"></td>
                <td width="80%">
                	<span style="background: red;width:200px"><?php echo form_error('txt_id_news');?></span>
                </td>
    </tr> 
    
    
     <tr>
        <td>Vị trí:</td>
        <td>
        <?php if(isset($show->order_news_product)) {?>
        <input type="text" name="txt_order" style="width:320px;" value="<?php echo $show->order_news_product?>" />
        <?php } else { ?>
        <input type="text" name="txt_order" style="width:320px;" value="<?php set_value('txt_order')?>" />
        <?php } ?>
        
        </td>
    </tr>
    <tr>
        <td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_order');?></td>
    </tr>
    
     
    <tr>
        <td>Meta Tag Description:</td>
        <td>
        <?php if(isset($show->meta_description)) {?>
        <textarea name="txt_meta_description" rows="5" cols="40"><?php echo $show->meta_description?></textarea>
        
        <?php } else { ?>
        <textarea name="txt_meta_description" rows="5" cols="40"></textarea>
        
        <?php } ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_meta_description');?></td>
    </tr>
     <tr>
        <td>Meta Tag Keywords:</td>
        <td>
        <?php if(isset($show->meta_keyword)) {?>
        <textarea name="txt_meta_keyword" rows="5" cols="40"><?php echo $show->meta_keyword?></textarea>
        
        <?php } else { ?>
        <textarea name="txt_meta_keyword" rows="5" cols="40"></textarea>
        
        <?php } ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_meta_keyword');?></td>
    </tr>
    <tr>
        <td>Nội dung ngắn:</td>
        <td>
        <?php if(isset($show->title_short)) {?>
        <textarea class="ckeditor" name="txt_title_short" rows="5" cols="40"><?php echo $show->title_short;?></textarea>
        
        <?php } else { ?>
        <textarea class="ckeditor" name="txt_title_short" rows="5" cols="40"></textarea>
        
        <?php } ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_title_short');?></td>
    </tr>
    
     <tr>
        <td>Nội dung:</td>
        <td>
        <?php if(isset($show->body)) {?>
        <textarea class="ckeditor" name="txt_body" rows="5" cols="40"><?php echo $show->body?></textarea>
        
        <?php } else { ?>
        <textarea class="ckeditor" name="txt_body" rows="5" cols="40"></textarea>
        
        <?php } ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_body');?></td>
    </tr>
    
    
    
    
     <tr>
        <td width="20%">Chọn:</td>
        <td width="80%">
        	<select name="txt_active">
            
            	<option value="1" <?php echo set_select('txt_active',1)?>
				<?php if(@$show->active == 1) echo "selected";?>>Show</option>
                <option value="0" <?php echo set_select('txt_active',0)?>
                <?php if(@$show->active == 0) echo "selected";?>>Không</option>
            </select>
        </td>
    </tr>
   
    <tr>
        <td width="20%">Vị trí show:</td>
        <td width="80%">
        	<select name="txt_vt_active">
            
            	<option value="1" <?php echo set_select('txt_active',1)?>
				<?php if(@$show->vitri_show == 1) echo "selected";?>>Trang chủ</option>
                <option value="2" <?php echo set_select('txt_active',2)?>
				<?php if(@$show->vitri_show == 2) echo "selected";?>>Bên trái</option>
                <option value="3" <?php echo set_select('txt_active',3)?>
				<?php if(@$show->vitri_show == 3) echo "selected";?>>Bên phải</option>
                <option value="0" <?php echo set_select('txt_active',0)?>
                <?php if(@$show->vitri_show == 0) echo "selected";?>>Không</option>
            </select>
        </td>
    </tr>
    
    <tr>
        <td colspan="2" align="center">
        	<a  class="button" onclick="$('#frm_add').submit()" href="javascript:void(0)">Lưu lại</a>
                 <a  class="button" href="<?php echo base_url().'admin/product/'?>">Quay lại</a>
        </td>
    </tr>

</table>
</form>
</div>